package api

import (
	"github.com/gin-gonic/gin"
	"net/http"
	"video/internal/model/servce"
	"video/internal/request"
)

func VideoAdd(c *gin.Context) {
	var req request.VideoReq
	err := c.ShouldBind(&req)
	if err != nil {
		c.JSON(http.StatusInternalServerError, gin.H{"message": "参数获取失败"})
		return
	}
	err = servce.AddVideo(req)
	if err != nil {
		c.JSON(http.StatusInternalServerError, gin.H{"message": "发布失败"})
		return
	}
	c.JSON(http.StatusOK, gin.H{"message": "发布成功"})
}
